<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>菜单选择</title>
</head>
<lui:context/>
<u:View basePath="/res-system/menu" res="jquery.ztree" userJS="selectMenu" delayLoadJs="false">
<body>
    <lui:dialogBody>
        <form class="m-cust m-narrow" id='selectMenuFrm'>
        	<input hidden="hidden" name="type" value="${requestScope.type }">
        	<input hidden="hidden" name="pageKey" value="${requestScope.pageKey }">
        	<input hidden="hidden" name="id" value="${requestScope.id }">
        	<!-- 查询菜单 -->
        	<c:if test="${requestScope.type eq '2' or requestScope.type eq '1'}">
	       		<lui:ajax url="${ctx }/sys/menu/find/currentRole/menus" id="queryMenuTreeAjax" type="get" onSuccess="SelectMenuPage.onFindMenuSucc"/>
        	</c:if>
        	<lui:tree nodeTitleKey="resName" nodeIdKey="resId" ajax="queryMenuTreeAjax" id="menuTree"
	            parentIdKey="resPid" dataStructure="array" nodeNameKey="resName" nodeChildrenKey="children"
	            onCurrentNodeSelected="SelectMenuPage.onSelected" maxLayer="3" expandAll="true" checkable="true"
	            onChecked="SelectMenuPage.onChecked" onFinishLoad="SelectMenuPage.onFinishLoad"/>
        </form>
    </lui:dialogBody>
    <lui:dialogFooter>
       <button class="btn btn-primary m-btn" type="button" onclick="SelectMenuPage.save()">选择</button>
       <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box">关闭</button>
    </lui:dialogFooter>
</body>
</u:View>
</html>